import http from '@/utils/request'
import { base } from '@/config'

const cashSettlementApi = {
  //现金结算-数据概况-现金走势图
  getCashTrend: params => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleLine`, { params })
  },

  // 现金结算-数据概况-统计数据
  getCashStatistics: params => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleTotal`, { params })
  },

  //现金结算-平台现金核算-核算列表
  getCashSettlementList: params => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleList`, { params })
  },
  //现金结算-平台现金核算-核算列表tab统计
  getCashSettlementTabs: () => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleTab`)
  },
  //获取现金对账单列表
  getCashList: params => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleSupplierList`, { params })
  },
  //获取积分列表tab统计
  getCashSettleSupplierTab: params => {
    return http.get(
      `${base.finance}/platformStatistics/getCashSettleSupplierTab/${params.settleId}`,
      { params }
    )
  },

  //积分结算对账单-对账单详情
  getCashSettlementBillDetail: settleId => {
    return http.get(`${base.finance}/platformStatistics/getCashSettleDetail/${settleId}`, {
      params: { settleId }
    })
  },
  //积分结算对账单-完成结算
  auditCashSettlementBill: params => {
    return http.postJson(`${base.finance}/platformStatistics/cashSuccess`, params)
  }
}

export default cashSettlementApi
